<template>
  <el-form :model="categoryFormData" label-width="120px" size="small">
    <el-row v-if="formProps.parentLabel && formProps.parentLabel.length > 0">
      <el-col :span="20">
        <el-form-item label="父级名称：">
          <el-input v-model="categoryFormData.parentLabel" disabled></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="20">
        <el-form-item label="分类名称：">
          <el-input v-model="categoryFormData.name"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
import { CommUtil } from "@/utils/CommonUtil";


export default {
  name: "CategoryForm",
  props: {
    formProps: {
      type: Object,
      default: {
        kind: '',
        parentId: '',
        parentLabel: '',
        name: '',
      }
    }
  },
  data() {
    return {
      categoryFormData: {
        kind: this.formProps.kind,
        parentId: this.formProps.parentId,
        parentLabel: this.formProps.parentLabel,
        name: this.formProps.name,
      }
    }
  },

  methods: {

    takeFormData() {
      return { ...this.categoryFormData }
    }

  }
}
</script>

<style scoped></style>